package edu.hda.pt.utils.connections.rmi;

import java.rmi.Remote;
import java.rmi.RemoteException;

import edu.hda.pt.utils.Stream;
import edu.hda.pt.utils.TestObject;

/**
 * Java RMI remote interface providing the remote server methods for the client
 * 
 * @author Marc Hammerton
 * 
 */
public interface PTServerRMII extends Remote {

	/**
	 * Sends and receives a Boolean value
	 * 
	 * @param data
	 *            - the Boolean value
	 * @return the Boolean value from the server
	 * @throws RemoteException
	 */
	public boolean getBool(boolean data) throws RemoteException;

	/**
	 * Sends and receives a Byte value
	 * 
	 * @param data
	 *            - the Byte value
	 * @return the Byte value from the server
	 * @throws RemoteException
	 */
	public byte[] getBytes(byte[] data) throws RemoteException;

	/**
	 * Sends and receives an Integer value
	 * 
	 * @param data
	 *            - the Integer value
	 * @return the Integer value from the server
	 * @throws RemoteException
	 */
	public int getInteger(int data) throws RemoteException;

	/**
	 * Sends and receives a Long value
	 * 
	 * @param data
	 *            - the Long value
	 * @return the Long value from the server
	 * @throws RemoteException
	 */
	public long getLong(long data) throws RemoteException;

	/**
	 * Sends and receives an object
	 * 
	 * @param data
	 *            - the object
	 * @return the object from the server
	 * @throws RemoteException
	 */
	public TestObject getObject(TestObject data) throws RemoteException;

	/**
	 * Sends and receives a String value
	 * 
	 * @param data
	 *            - the String value
	 * @return the String value from the server
	 * @throws RemoteException
	 */
	public String getString(String data) throws RemoteException;

	/**
	 * Sends and receives a stream object
	 * 
	 * @param stream
	 *            - the stream object which indicates to start or stop a stream
	 * @param client
	 *            - the call back object
	 * @return the stream object from the server with the new stream state
	 * @throws RemoteException
	 */
	public Stream handleStream(Stream stream, PTClientRMICallbackI client)
			throws RemoteException;
}
